#243: Do not warn for unmapped source properties on maps#244
#243: Do not warn for unmapped source properties on maps#244thunderhook wants to merge 4 commits into
Conversation
|
@thunderhook good catch. Your implementation works for a single source parameter of type Map<String, ?>, but Map<Integer, ?> still disables the warnings. Also, Map handling is missing Map-as-normal-source detection that MapStruct performs. |
|
Thanks @hduelme ! I've adapted the check and:
Would you have a look at it again? Thanks in advance! |
hduelme
left a comment
There was a problem hiding this comment.
@thunderhook really nice improvement. I looked through your implementation. I left two small comments. Otherwise, approved from my side.
| } | ||
|
|
||
| PsiType[] parameters = ct.getParameters(); | ||
| if ( parameters.length == 0 ) { |
There was a problem hiding this comment.
Like in FromMapMappingMapTypeInspection parameters.length should be check against 2, that is nearer on the implementation of MapStruct.
This should catch invalide code like Map<String, String, String>.
| public abstract CorporateAction mapWithMultipleSourcesAndMapName( | ||
| Map<String, String> rowValues, | ||
| LocalDate payDate | ||
| ); |
There was a problem hiding this comment.
The test looks correct.
I think it would be cleaner to split this into separate custom tests. Typically, erroneous and non-erroneous cases aren’t mixed together in the same test.
Thanks for the review! I've adapted the code. |
No description provided.